<PageHeader as |p|>
  <p.levelLeft>
    <h1 class="title is-3">
      {{#link-to "vault.cluster.access.leases"}}Leases{{/link-to}}
    </h1>
  </p.levelLeft>
</PageHeader>

{{#unless (or (eq model.httpStatus 400) (eq model.httpStatus 404))}}
  {{model.message}}
{{/unless}}

{{#if (eq model.httpStatus 400)}}
  <AlertBanner
    @type="danger"
    @message="{{model.keyId}} is not a valid lease ID"
  />
{{else if (eq model.httpStatus 404)}}
  <EmptyState
    @title="No leases with that ID"
    @message="Unable to find lease for the ID &quot;{{model.keyId}}&quot;. Try going back to the lookup and re-entering the ID."
  >
    {{#link-to "vault.cluster.access.leases" class="link"}}
      Back to lookup
    {{/link-to}}
  </EmptyState>
{{else if (eq model.httpStatus 403)}}
  <EmptyState
    @title="You don't have access to a lease with that ID"
    @message="If you think you've reached this page in error, please contact your administrator."
  >
    {{#link-to "vault.cluster.access.leases" class="link"}}
      Back to lookup
    {{/link-to}}
  </EmptyState>
{{else}}
  {{#each model.errors as |error|}}
    <AlertBanner
      @type="danger"
      @message={{error}}
    />
  {{/each}}
{{/if}}
